Optimal. Leaf size=43 \[ -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d}+\frac {a^2 \sec (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3957, 2912, 12,
45} \begin {gather*} -\frac {a^2 \cos (c+d x)}{d}+\frac {a^2 \sec (c+d x)}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 45
Rule 2912
Rule 3957
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^2 \sin (c+d x) \, dx &=\int (-a-a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {a^2 (-a+x)^2}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a d}\\ &=\frac {a \text {Subst}\left (\int \frac {(-a+x)^2}{x^2} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a \text {Subst}\left (\int \left (1+\frac {a^2}{x^2}-\frac {2 a}{x}\right ) \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=-\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d}+\frac {a^2 \sec (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 31, normalized size = 0.72 \begin {gather*} \frac {a^2 (1-2 \log (\cos (c+d x))+\sin (c+d x) \tan (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 34, normalized size = 0.79
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\sec \left (d x +c \right )-\frac {1}{\sec \left (d x +c \right )}+2 \ln \left (\sec \left (d x +c \right )\right )\right )}{d}\) | \(34\) |
default | \(\frac {a^{2} \left (\sec \left (d x +c \right )-\frac {1}{\sec \left (d x +c \right )}+2 \ln \left (\sec \left (d x +c \right )\right )\right )}{d}\) | \(34\) |
risch | \(2 i a^{2} x -\frac {a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {4 i a^{2} c}{d}+\frac {2 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(103\) |
norman | \(-\frac {4 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}+\frac {2 a^{2} \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(113\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 41, normalized size = 0.95 \begin {gather*} -\frac {a^{2} \cos \left (d x + c\right ) + 2 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {a^{2}}{\cos \left (d x + c\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.17, size = 51, normalized size = 1.19 \begin {gather*} -\frac {a^{2} \cos \left (d x + c\right )^{2} + 2 \, a^{2} \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - a^{2}}{d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int 2 \sin {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \sin {\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.53, size = 51, normalized size = 1.19 \begin {gather*} -\frac {a^{2} \cos \left (d x + c\right )}{d} - \frac {2 \, a^{2} \log \left (\frac {{\left | \cos \left (d x + c\right ) \right |}}{{\left | d \right |}}\right )}{d} + \frac {a^{2}}{d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.06, size = 41, normalized size = 0.95 \begin {gather*} -\frac {a^2\,\left (2\,\cos \left (c+d\,x\right )\,\ln \left (\cos \left (c+d\,x\right )\right )+{\cos \left (c+d\,x\right )}^2-1\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________